package hot100;

import DTO.TreeNode;

public class invertTree {
    public TreeNode invertTree(TreeNode root) {
        retcur(root);
        return root;

    }
    void retcur(TreeNode root) {
        if(root == null){
            return;
        }
        TreeNode tem = root.left;
        root.left = root.right;
        root.right = tem;
        invertTree(root.left);
        invertTree(root.right);

    }
}
